<?php
class LoginController extends BaseController
{
	public function loginCheck()
	{
		$username=Input::get('username');
		$password=Input::get('password');

		$validator = Validator::make(
		    array('username' => $username,'password'=> $password),
		    array('username' => 'required','password'=>'required')
		);

		if($validator->fails())
		{
			return Response::json( CMSException::$infoErr);
		}

		$login=new LoginService;
		$login->setUsername($username);
		$login->setpsssword($password);

		$errCode=$login->loginCheck();
		return Response::json($errCode);
	}
}